Adapt Swagger type mapping to OpenApi 2.0#862
Conversation
|
Thank you for the PR! I'm working in this area at the moment, but won't be able to finish for a while, but I'll get around to this PR as soon as possible. Thanks again, much appreciated! |
|
Thanks for the feedback. If I should adapt anything, please let me know. Take your time - it's your free time after all. Thanks for investing it in this project! |
# Conflicts: # samples/WebApplication/Program.cs # src/Vogen/GenerateCodeForAspNetCoreOpenApiSchema.cs # src/Vogen/GenerateCodeForOpenApiSchemaCustomization.cs
OpenApiOptions did not work for Swashbuckle with OpenApi 1
…enced Check both OpenApi version and reference to OpenApiOptions / JsonSchemaType
8d8bd42 to
41b97a2
Compare
|
Hi @SteveDunn, I tried to rebase on your latest changes, but I broke it and cannot figure out why. I get build errors: I don't understand what is happening and I didn't manage to find the generated file. I think I need some support here. |
|
I took another look at the issue and managed to fix it. |
|
Thank you! I should have time to look at it over the weekend. |
|
LGTM! Thanks for the great work! I've merged this and will rebase the snapshots in the next commit. |
This PR fixes #856.
Microsoft.OpenApi 2.0 introduced some breaking changes and while #844 addressed them in
GenerateCodeForAspNetCoreOpenApiSchema, this PR adaptsGenerateCodeForOpenApiSchemaCustomization.I moved
OpenApiVersionBeingUsedandOpenApiSchemaUtilsto top level and adapted the generation code.It works with both OpenApi 1.x
and OpenApi 2.x
I added a new
OpenApiModeto the ConsumersWebApplicationandWebApplication.Sharedprojects. They supportMicrosoftAndScalar,Swashbuckle-net8, andSwashbuckle-net10. I'm not sure about the naming, though.Please review this PR carefully, since I do not have a comprehensive understanding of Vogen or Source Generators in general :-)